/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.hieu.sms.model;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * 
 * @author do_th
 */
@Entity
@Table(name = "rank_param")
@NamedQueries({
		@NamedQuery(name = "RankParam.findAll", query = "SELECT r FROM RankParam r"),
		@NamedQuery(name = "RankParam.findById", query = "SELECT r FROM RankParam r WHERE r.id = :id"),
		@NamedQuery(name = "RankParam.findByRankId", query = "SELECT r FROM RankParam r WHERE r.rankId = :rankId"),
		@NamedQuery(name = "RankParam.findByName", query = "SELECT r FROM RankParam r WHERE r.name = :name"),
		@NamedQuery(name = "RankParam.findByScoreMin", query = "SELECT r FROM RankParam r WHERE r.scoreMin = :scoreMin"),
		@NamedQuery(name = "RankParam.findByScoreMax", query = "SELECT r FROM RankParam r WHERE r.scoreMax = :scoreMax") })
public class RankParam extends AbstractPersistentEntity {
	private static final long serialVersionUID = 1L;
	@Id
	@Column(name = "id", updatable = false)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "RankParamSequence")
	@SequenceGenerator(name = "RankParamSequence", sequenceName = "seq_rank_param", allocationSize = 1)
	private Long id;
	@Basic(optional = false)
	@Column(name = "rank_id")
	private String rankId;
	@Basic(optional = false)
	@Column(name = "name")
	private String name;
	// @Max(value=?) @Min(value=?)//if you know range of your decimal fields
	// consider using these annotations to enforce field validation
	@Column(name = "score_min")
	private Float scoreMin;
	@Column(name = "score_max")
	private Float scoreMax;

	public RankParam() {
	}

	public RankParam(Long id) {
		this.id = id;
	}

	public RankParam(Long id, String rankId, String name) {
		this.id = id;
		this.rankId = rankId;
		this.name = name;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getRankId() {
		return rankId;
	}

	public void setRankId(String rankId) {
		this.rankId = rankId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Float getScoreMin() {
		return scoreMin;
	}

	public void setScoreMin(Float scoreMin) {
		this.scoreMin = scoreMin;
	}

	public Float getScoreMax() {
		return scoreMax;
	}

	public void setScoreMax(Float scoreMax) {
		this.scoreMax = scoreMax;
	}

	@Override
	public int hashCode() {
		int hash = 0;
		hash += (id != null ? id.hashCode() : 0);
		return hash;
	}

	@Override
	public boolean equals(Object object) {
		// TODO: Warning - this method won't work in the case the id fields are
		// not set
		if (!(object instanceof RankParam)) {
			return false;
		}
		RankParam other = (RankParam) object;
		if ((this.id == null && other.id != null)
				|| (this.id != null && !this.id.equals(other.id))) {
			return false;
		}
		return true;
	}

	@Override
	public String toString() {
		return "com.hieu.sms.model.RankParam[ id=" + id + " ]";
	}

}
